Repository navigation
SysML2.NET.Validation with generated FluentValidation validators for … - #444
Conversation
…PSM request DTOs.
| /// <remarks> | ||
| /// The generated validator constructor invokes this method once, after registering its generated rules. | ||
| /// </remarks> | ||
| protected virtual void AddCustomValidation() |
There was a problem hiding this comment.
This virtual method has to be called directly from the constructor, remove redundant call on each constructor of subclasses. To not have the SQ issue, call a private non virtual method that will call the virtual one
| <Authors>Sam Gerené</Authors> | ||
| <RequireLicenseAcceptance>true</RequireLicenseAcceptance> | ||
| <PackageReleaseNotes> | ||
| [Add] FluentValidation validators for the PSM request DTOs (#405) |
There was a problem hiding this comment.
don't add package release notes
| </ItemGroup> | ||
| <ItemGroup Label="Libraries"> | ||
| <PackageVersion Include="BouncyCastle.Cryptography" Version="2.7.0" /> | ||
| <PackageVersion Include="FluentValidation" Version="11.12.0" /> |
There was a problem hiding this comment.
It's not the latest version. Bump to the latest one and only target Net10 on the validation project
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <ProjectReference Include="..\SysML2.NET\SysML2.NET.csproj" /> |
There was a problem hiding this comment.
Make reference to the SysML2.NET.Extensions instead
| /// </summary> | ||
| public TagRequestValidator() | ||
| { | ||
| this.RuleFor(dto => dto.Name).NotNull(); |
There was a problem hiding this comment.
For string, verify that it's not empty neither
| public DataVersionRequestValidator() | ||
| { | ||
| this.RuleFor(dto => dto.Identity).SetValidator(new DataIdentityRequestValidator()); | ||
| this.RuleFor(dto => dto.Payload).SetInheritanceValidator(validators => |
There was a problem hiding this comment.
Note for later, we will also have the need to add custom validation to add all CORE validator
|



…PSM request DTOs.
Prerequisites
Description
Implement #405 to generate validation project for request DTOs.